#include <iostream>
#include <string>
#include <map>
using namespace std;


int main(){
	map<string,bool> mp;
	string ans="";
	while(true){
		string input;
		cin>>input;
		if(input == "0")
			break;
//		cout<<mp[input]<<endl;
		if(mp[input] == false){
			mp[input] = true;
			ans = ans+input;
		}
		else{
			continue;
		}
	}
	cout<<ans;
	return 0;
}
